import Request from '@/utils/request'

export function userLogin(params) {
    return Request.post(
        'user/login',
        params
    )
}

export function userLogout(params) {
    return Request.get(
        'user/logout',
        params
    )
}

export function userRegister(params) {
    return Request.post(
        'user/register',
        params
    )
}

export function imageCode(params) {
    return Request.get(
        'image_code',
        params
    )
}


export function checkUsername(username) {
    return Request.get(
        `username/${username}`
    )
}

export function checkEmail(email) {
    return Request.get(
        `email/${email}`
    )
}

export function activeUser(active_user) {
    return Request.get(
        `user/active/${active_user}`,
    )
}

export function userList(params) {
    return Request.get(
        'user/list',
        params
    )
}

export function userDetail(user_id) {
    return Request.get(
        `user/list/${user_id}`
    )
}

export function userDelete(user_id) {
    return Request.delete(
        `user/${user_id}`
    )
}

export function userEdit(user_id,params) {
    return Request.put(
        `user/${user_id}`,
        params
    )
}

export function userInfoDetail(user_id) {
    return Request.get(
        `user/info/${user_id}`,
    )
}

export function userInfoEdit(user_id,params) {
    return Request.put(
        `user/info/${user_id}`,
        params
    )
}
